DynamicTextShape AddHatchPatternLine

Adds a Line hatch pattern to the shape

Overloads

public void AddHatchPatternLine(float borderGap, HatchLineBorderGapDirection borderGapDirection, float lineGap, float lineAngle, float baseX, float baseY, HatchLineStyle hatchStyle, bool withOffset, HatchOffsetAlgorithm algorithm, HatchCornerStyle cornerStyle, int individualHatchLineRepeatCount)
public void AddHatchPatternLine(float borderGap, HatchLineBorderGapDirection borderGapDirection, float lineGap, float lineAngle, float baseX, float baseY, HatchLineStyle hatchStyle, bool withOffset, HatchOffsetAlgorithm algorithm, HatchCornerStyle cornerStyle, bool applySmoothing)

 

Return value

void  

 

Parameters

float borderGap Set the boarder gap
float lineGap Set the line gap
float lineAngle Set the line angle
float baseX Set an X coordinate through which at least one hatch line will pass
float baseY Set an Y coordinate through which at least one hatch line will pass
bool withOffset Set whether the hatch should have an offset.
HatchLineBorderGapDirection borderGapDirection Set the boarder gap direction
HatchLineStyle hatchStyle Set the hatching style
HatchOffsetAlgorithm algorithm Set the hatching algorithm
HatchCornerStyle cornerStyle Set the corner style
int individualHatchLineRepeatCount Set the number of times the individual hatch line should repeat.

 

Example

Copy
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);
scanDocument.SetScanDocumentName("SerialNumberSample");

// Create a serial number variable
SerialNumber serialVar = new SerialNumber("SerialID");
// Add new line 
serialVar.SerialItemList.Add(new NewLineSerialItem());
// Add static text part of the serial number
TextSerialItem textPart = new TextSerialItem();
textPart.Text = "Serial # : ";
serialVar.SerialItemList.Add(textPart);

// Add the number serial item part
NumberSerialItem numberSerialItem = new NumberSerialItem();
numberSerialItem.IsCurrentNumberEnabled = true;
numberSerialItem.StartNumber = 1;
numberSerialItem.CurrentNumber = 1;
numberSerialItem.EndNumber = 10;
numberSerialItem.Increment = 1;
numberSerialItem.FixedLength = 3;
numberSerialItem.RepeatCount = 0;
numberSerialItem.NumarelRepresentation = NumberSystemStyle.Decimal;

serialVar.SerialItemList.Add(numberSerialItem);
serialVar.SerialItemList.Add(new NewLineSerialItem());

//Loop cycles
scanDocument.SetIterations(10);
//Add serialNumber to ScanDocument
scanDocument.AddSerialNumberVariable(serialVar);

if (scanDocument != null)
{
    VectorImage vectorImage = scanDocument.CreateVectorImage("image1", DistanceUnit.Millimeters);

    vectorImage.SetMarkSpeed(1000);
    vectorImage.SetJumpSpeed(2000);
    vectorImage.SetJumpDelay(100);
    vectorImage.SetMarkDelay(100);

    //Set Laser Delays
    vectorImage.SetLaserOnDelay(10);
    vectorImage.SetLaserOffDelay(10);

    DynamicArcTextShape dynamicArcText = new DynamicArcTextShape();
    dynamicArcText.Height = 5;
    dynamicArcText.VariableName = "arcText1";
    dynamicArcText.Text = "Sample Arc text";
    dynamicArcText.EvaluateVariableTags = true;
    dynamicArcText.FontName = "Arial";
    dynamicArcText.Center.X = 0;
    dynamicArcText.Center.Y = 0;
    dynamicArcText.Center.Z = 0;
    dynamicArcText.Radius = 20;
    dynamicArcText.StartAngle = 160 * (float)(Math.PI / 180);
    dynamicArcText.Clockwise = true;
    dynamicArcText.Align = ArcTextAlign.Baseline;

    dynamicArcText.SetLineHatchPattern(0.1f, 0, HatchLineStyle.Unidirectional, 1);

    // Characters from 0 to 255 or basically extended ASCII range is embedded
    Collection<UnicodeRange> unicodeRanges = new Collection<UnicodeRange>();
    UnicodeRange unicodeRange = new UnicodeRange();
    unicodeRange.StartingCharacter = Convert.ToChar(0x00);
    unicodeRange.EndingCharacter = Convert.ToChar(0xff);
    unicodeRanges.Add(unicodeRange);
    scanDocument.EmbedFont("Arial", FontStyle.Regular, unicodeRanges); // We need to embed the font for dynamic text shapes top be marked

    vectorImage.AddDynamicArcText(dynamicArcText, new SerialNumberEx(serialVar));
    scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()\r\nLaser.WaitForEnd()"));

    try
    {
        scanDocument.StartScanning();
    }
    catch
    {

    }
}